import { getReport } from '@/services/report';

export default {
  namespace: 'report',

  state: {
    reportData: {},
  },

  effects: {
    *getReportData({ payload }, { call, put }) {
      const response = yield call(getReport, payload);
      yield put({
        type: 'setReportData',
        payload: {
          ReportData: response,
        },
      });
    },
  },
  reducers: {
    setReportData(state, { payload }) {
      return {
        ...state,
        ...payload,
      };
    },
  },
};
